<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>短信发送</title>
    <link rel="stylesheet" href="/Public/css/bootstrap.min.css">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link rel="stylesheet" href="/Public/css/toast.css">
    <link rel="stylesheet" href="/Public/css/gxxjkefu-normalize.css">
    <link rel="stylesheet" href="/Public/css/model.css">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .content_box {
            margin: 0 auto;
            width: 80%;
        }

        .content_box span {
            display: inline-block;
            width: 100px;
        }

        .content_box select {
            width: 200px;
        }

        .item_box {
            padding-left: 80px;
            margin: 10px 0;
        }
    </style>
</head>
<body>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
            <div id="main_C">
                <div class="content_box">
                    <div class="item_box" style="padding: 0">
                        <!--<span>选择标识</span>-->
                        <div class="input-group-btn" style="display: block;">
                            <select id="msg_content" name="type" class="form-control" onchange="msg_change()"
                                    style="color: #959595;background: #eeeeee;border-bottom-left-radius: 3px;border-top-left-radius: 3px;width: 300px">
                                <volist name="msg" id="vo">
                                    <option value="<{$vo.id}>"><{$vo.name}>-<{$vo.content}></option>
                                </volist>
                            </select>
                        </div>

                        <div class="" style="display: block;">
                <textarea style="width: 500px;height: 200px;margin: 20px 0;" id="send_content" placeholder="特殊备注">
                </textarea>
                        </div>
                    </div>
                    <button style="width: 100px;margin-right: 60px" class="btn btn-info" id="search_submit"
                            onclick="send()">确定
                    </button>
                </div>
            </div>
        </div>
        </div>
        </div>
    </div>
</div>
</div>
<script src="/Public/js/jquery-3.2.1.js"></script>
<script src="/Public/js/layer/layer.js"></script>
<script src="/Public/js/layui/layui.js"></script>
<script src="/Public/js/toast.js"></script>

<script>
    //消息赋值
    function msg_change() {
        var content = $("#msg_content").find("option:selected").text();
        $('#send_content').val(content);

    }

    function send() {
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
//        var value=$('input[name="radio"]:checked').val();
        var content = $('#send_content').val();
        var phone = window.parent.get_phone();
        if (phone == "" || phone == null) {
            layer.close(index);
            layer.alert("请选择用户！", {title: '提示框', icon: 3});
            return false;

        }
        if (content == "" || content == null) {
            layer.close(index);
            layer.alert("请填写消息！", {title: '提示框', icon: 3});
            return false;

        }

        layer.alert("确认发送短信给用户？", {title: '提示框', icon: 3}, function (index) {
            $.post("<{$SERVER_NAME}>/User/message_send", {phone: phone, content: content}, function (data) {
//                console.log('00000002222',data);
                if (data.code = '1001') {
                    layer.alert("发送成功！", {title: '提示框', icon: 1});
                    window.location.reload();
                } else {
                    layer.alert("发送失败！", {title: '提示框', icon: 1});
                }
            });

        });
        layer.close(index);
        console.log('3333333333', value);
        console.log('phonephone', phone);
    }

</script>


</body>
</html>